<template>
	<view class="pad-lr-20 pad-tb-20">
		<view class="bgfff pad-lr-20 pad-tb-20 radius-16">
			<view class="display align-items borderbottom pad-tb-20">
				<image src="/static/img/icon_wenti.png" class="tit_img" mode=""></image>
				<view class="fontSize-32 ml10">{{title}}</view>
			</view>
			<view class="mar-top-20 fontSize-28">
			<tm-html :content="tx"></tm-html>
			</view>
			<view class="mar-top-200 display-ce align-items fontSize-26">
				<text>没有解决您的问题？</text><text style="color: #E23737;" @click="gotel">拨打电话</text>
			</view>
		</view>
	</view>
</template>

<script lang="ts" setup>
import { onLoad } from '@dcloudio/uni-app';
import { ref } from 'vue';
// import {question_detail,get_service_phone} from '@/utils/api'
onLoad((options)=>{
	id.value = options.id
	_question_detail()
	_get_service_phone()
})
const id = ref()
const title = ref()
const _question_detail =() =>{
	question_detail({id:id.value}).then(res=>{
			if(res.code==1){
				title.value = res.data.question_info.question
				tx.value = res.data.question_info.answer
			}
	})
}
const service_phone = ref()//客服电话
const _get_service_phone = () =>{
	get_service_phone().then(res=>{
		if(res.code==1){
			service_phone.value = res.data.service_phone
		}
	})
}
const tx = ref('')
const gotel =() =>{
	uni.makePhoneCall({
		phoneNumber:service_phone.value
	})
}
</script>

<style lang="scss">
@import 'problemdetails.scss';
</style>
